import java.util.*;

public class Library {
	Building building;
	List<Book> books;
	List booksWeak;
	Book mainBook;
	
	public Library()
	{
		books.add(new Book("TestBook", this));
		booksWeak.add(new Book("OtherTestBook", this));
		Book b = new Book("SomeBook", this);
		booksWeak.add(b);
		Book book = new Book("SomeBook", this);
		booksWeak.add(book);
		books.add(book);
		Book a = new Book("bla", this);
		mainBook = a;
	}
	
	public void CallSomeMethod()
	{
		for (Object obj : booksWeak)
		{
			Book book = (Book)obj;
			Library lib = book.GetBookLibrary();
			Author author = new Author("Richard Dawkins");
			book.SetAuthor(author);
		}
	}
	
	public Book GetLastBook()
	{
		return books.get(books.size() - 1);
	}
	
	public void CastingTest()
	{
		books.add(new ChildrensBook("The Golden Compass", this));
		Book somebook = (ChildrensBook)GetLastBook();
	}
	
	
}
